<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<f:view beforePhase="#{listUserManaged.initPage}">
	<jsp:include page="./jsp/header.jsp" />
	<!-- ===========end header ======================== -->
	<!-- Begin vung dieu kien tim kiem -->
	<h:form id="ADM002">
		<table class="tbl_input" border="0" width="90%" cellpadding="0"
			cellspacing="0">
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td>会員名称で会員を検索します。検索条件無しの場合は全て表示されます。</td>
			</tr>
			<tr>
				<td width="100%">
				<table class="tbl_input" cellpadding="4" cellspacing="0">
					<tr>
						<td class="lbl_left">氏名:</td>
						<td align="left"><h:inputText style="txBox"
							value="#{listUserManaged.fullName}" size="20"
							onfocus="this.style.borderColor='#0066ff';"
							onblur="this.style.borderColor='#aaaaaa';" /></td>
						<td></td>
					</tr>
					<tr>

						<td class="lbl_left">グループ:</td>
						<td align="left" width="80px"><h:selectOneListbox size="1"
							value="#{listUserManaged.groupId}">
							<f:selectItems value="#{listUserManaged.itemGroups}" />
						</h:selectOneListbox> <t:saveState value="#{listUserManaged.itemGroups}" /></td>
						<td align="left"><h:commandButton style="btn" value="検索"
							action="#{listUserManaged.doSearch}" />
							<h:commandButton style="btn" value="新規追加"
							action="#{listUserManaged.doSearch}" />
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		<!-- End vung dieu kien tim kiem -->

		<!-- Begin vung hien thi danh sach user -->
		<table class="tbl_list" border="1" cellpadding="4" cellspacing="0"
			width="80%">

			<tr class="tr2">
				<th align="center" width="20px">ID</th>
				<th align="left">氏名<c:if
					test="${listUserManaged.sortByFullName == null || listUserManaged.sortByFullName == 'ASC'}">
					<h:commandLink action="#{listUserManaged.doSort}" value="▲▽">
						<f:param name="sortByFullName" value="DESC"></f:param>
						<f:param name="sortType" value="full_name"></f:param>
					</h:commandLink>
				</c:if> <c:if test="${listUserManaged.sortByFullName == 'DESC'}">
					<h:commandLink immediate="true" action="#{listUserManaged.doSort}"
						value="△▼">
						<f:param name="sortByFullName" value="ASC" />
						<f:param name="sortType" value="full_name" />
					</h:commandLink>
				</c:if></th>
				<th align="left">生年月日</th>
				<th align="left">グループ</th>
				<th align="left">メールアドレス</th>
				<th align="left" width="70px">電話番号</th>
				<th align="left">日本語能力 <c:if
					test="${listUserManaged.sortByCodeLevel == null || listUserManaged.sortByCodeLevel == 'ASC'}">
					<h:commandLink immediate="true" action="#{listUserManaged.doSort}"
						value="▲▽">
						<f:param name="sortByCodeLevel" value="DESC" />
						<f:param name="sortType" value="code_level" />
					</h:commandLink>
				</c:if> <c:if test="${listUserManaged.sortByCodeLevel == 'DESC'}">
					<h:commandLink immediate="true" action="#{listUserManaged.doSort}"
						value="△▼">
						<f:param name="sortByCodeLevel" value="ASC" />
						<f:param name="sortType" value="code_level" />
					</h:commandLink>
				</c:if></th>
				<th align="left">失効日 <c:if
					test="${listUserManaged.sortByEndDate == null || listUserManaged.sortByEndDate == 'DESC'}">
					<h:commandLink immediate="true" action="#{listUserManaged.doSort}"
						value="△▼">
						<f:param name="sortByEndDate" value="ASC" />
						<f:param name="sortType" value="end_date" />
					</h:commandLink>
				</c:if> <c:if test="${listUserManaged.sortByEndDate == 'ASC'}">
					<h:commandLink immediate="true" action="#{listUserManaged.doSort}"
						value="▲▽">
						<f:param name="sortByEndDate" value="DESC" />
						<f:param name="sortType" value="end_date" />
					</h:commandLink>
				</c:if></th>
				<th align="left">点数</th>
			</tr>
			<t:dataList id="data" value="#{listUserManaged.lsUserDetailDto}" var="item">
				<f:verbatim>
					<tr>
						<td align="right">
				</f:verbatim>
				<h:commandLink value="#{item.userId }" />
				<f:verbatim>
					</td>
					<td>
				</f:verbatim>
				<h:outputText value="#{item.fullName}" />
				<f:verbatim>
					</td>
					<td align="center">
				</f:verbatim>
				<h:outputText value="#{item.birthday}" >
					<f:convertDateTime pattern="dd/MM/yyyy"/>
				</h:outputText>
				<f:verbatim>
					</td>
					<td>
				</f:verbatim>
				<h:outputText value="#{item.groupName}" />
				<f:verbatim>
					</td>
					<td>
				</f:verbatim>
				<h:outputText value="#{item.email}" />
				<f:verbatim>
					</td>
					<td>
				</f:verbatim>
				<h:outputText value="#{item.tel}" />
				<f:verbatim>
					</td>
					<td>
				</f:verbatim>
				<h:outputText value="#{item.nameLevel}" />
				<f:verbatim>
					</td>
					<td align="center">
				</f:verbatim>
				<h:outputText value="#{item.endDate}">
					<f:convertDateTime pattern="dd/MM/yyyy"/>
				</h:outputText>
				<f:verbatim>
					</td>
					<td align="right">
				</f:verbatim>
				<h:outputText value="#{item.total}" />
				<f:verbatim>
					</td>
					</tr>
				</f:verbatim>
			</t:dataList>

			<t:saveState value="#{listUserManaged.lsUserDetailDto}" />
		</table>
		<!-- End vung hien thi danh sach user -->

		<!-- Begin Pagging -->
		<table>
            <tr>

	            <td>
					<h:outputText value="#{listUserManaged.strPaging}" escape="false"></h:outputText>
	            </td>
	         	<!--<td>
	            	<t:dataScroller for="data" paginatorMaxPages="3" paginator="true" immediate="true" fastStep="2"></t:dataScroller>
	            </td>
            --></tr>
		</table>
		<!-- End Pagging -->
	</h:form>
	<!-- ============begin footer====================== -->
	<jsp:include page="./jsp/footer.jsp" />
</f:view>
